<?php

declare(strict_types=1);

namespace App\Amqp\Producers;

use App\HscoinConf;
use Hyperf\Amqp\Annotation\Producer;
use Hyperf\Amqp\Message\ProducerMessage;

use function Hyperf\Support\env;

#[Producer(exchange: "user", routingKey: "user")]
class UserBalanceProducer extends ProducerMessage
{

    public function __construct($data)
    {
        // 设置不同 pool
        //$this->poolName = 'pool';

        $this->payload = [
            'opt' => [
                'user' => ['type' => HscoinConf::CATEGORY_EXPENSE_EXCHANGE],
                'from' => env('APP_NAME', 'yaoli')
            ],
            'data' => $data,
        ];
    }
}
